package com.yf.dao.course;

import com.yf.dao.BaseDao;
import com.yf.entity.course.LessonEntity;
import com.yf.entity.course.LessonOrderItemEntity;
import com.yf.vo.LearningNumber;
import com.yf.vo.LessonBackVo;
import com.yf.vo.LessonRecordVO;
import com.yf.vo.OptCourseBackVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 章节Dao
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Oct 23 16:19:27 CST 2018
 */
public interface LessonDao extends BaseDao<LessonEntity> {

    List<LessonEntity> getList(Long courseId);

    Integer getCount(Long courseId);

    /**
     * back 章节信息
     * @return
     */
    List<LessonBackVo> lessonList(Map<String, Object> params);
    List<OptCourseBackVo> courseList();

    /**
     * 查询章节购买人数
     */
    List<LearningNumber> getLearningNumber(List<Long> lessonIds);

    /**
     * 章节是否购买
     */
    List<LessonOrderItemEntity> lessonPaid(@Param("userId") Long userId, @Param("list") List<Long> list);

    LessonEntity getLesson(Long lessonId);

    List<String> getLessonUrlByCourseId(Long courseId);

    List<LessonEntity> getListByIds(List<Long> list);

    //用户购买的章节
    List<LessonRecordVO> getPaidLessonList(Long courseId);
}
